package day05;
import java.util.Arrays;
public class Arrary2 {
    public static void main(String[] args) {
        int[] aa=new int[3];
        double []ac=new double[4];
        boolean[]ad=new boolean[3];
        int[]aaa=new int[]{1,2,3,};
        int[]aab={2,3,4,};
        int[]aac;
        aac=new int[]{1,2,3,};

        //
        int []z=new int[3];
        System.out.println("数组的长度"+z.length);
        System.out.println(z[0]);
        z[0]=200;
        z[1]=300;
        z[2]=400;
        System.out.println(z.length-1);
        //
        int []x=new int[5];
        for(int i=0;i<x.length;i++){
            x[i]=(int)(Math.random()*100);
            System.out.println(x[i]);
        }
        Arrays.sort(x);
        System.out.println("排序后：");
        for(int i=0;i<x.length;i++) {
            x[i] = (int) (Math.random() * 100);
            System.out.println(x[i]);
        }

        //
        int[] arr=new int[10];
        for(int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*100);
            System.out.println(arr[i]);
        }
        int max=arr[0];
        for(int i=1;i<arr.length;i++){
            if(arr[i]>max){
                max=arr[i];
            }
        }
        System.out.println("最大值为"+max);

    }
}
